<template>
  <div class="cssEffectDemo">
    <div class="box">
      <h1>CSS</h1>
    </div>
  </div>
</template>

<script setup lang="ts"></script>

<style lang="scss" scoped>
.cssEffectDemo {
  .box {
    margin: 0 auto;
    position: relative;
    width: 300px;
    height: 400px;
    background: rgb(0 0 0 / 80%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    &::before {
      content: '';
      position: absolute;
      width: 240px;
      height: 130%;
      background: linear-gradient(#0cf, #d500f9);
      animation: animate 5s linear infinite;
    }

    @keyframes animate {
      from {
        transform: rotate(0deg);
      }

      to {
        transform: rotate(360deg);
      }
    }

    &::after {
      content: '';
      position: absolute;
      background: #0e1538;
      inset: 10px;
      border-radius: 20px;
    }

    h1 {
      color: #fff;
      font-size: 100px;
      z-index: 2;
    }
  }
}
</style>
